#ifndef _CMESH_H_
#define _CMESH_H_

#include "GameComponentTemplate.h"
#include "Ogre.h"

using namespace Ogre;

class GameComponent;

class CMeshTemplate : public GameComponentTemplate {
public:
	Ogre::String meshFileName; //static 
	Ogre::Entity *mEntity;
	
	CMeshTemplate();
	CMeshTemplate(Ogre::String meshName);
	~CMeshTemplate();

	virtual const comp_id_type& componentID() const {
		return mComponentID;
	}
	virtual const comp_id_type& familyID() const {
		return mFamilyID;
	}

	virtual GameComponent *makeComponent();

private:
	static comp_id_type mComponentID;
	static comp_id_type mFamilyID;
};

class CMesh : public GameComponent {
public:
	Ogre::String meshFileName;
	Ogre::Entity *mEntity;

	CMesh();
	CMesh(Ogre::String meshName);
	CMesh(CMeshTemplate* ct);
	
	~CMesh();

	void update();
	void setup();

	virtual const comp_id_type& familyID() const { return mFamilyID; }
	virtual const comp_id_type& componentID() const { return mComponentID; }
private:
	static comp_id_type mFamilyID;
	static comp_id_type mComponentID;
};

#endif
